
/**
 * @description 首页
 */
import React from "react"

import HomeStatis from "./components/Statis"
import CalendarBox from "./components/CalendarBox"
import HomeChart from "./components/HomeChart"
import HomeNotice from '@/components/Notice/Notice2'

function HomePage({ home, chart, chartTap, actKey }) {
  let base = home.base
  return (
    <div className="home-wrapper">

      {/* 1. 公告 */}
      {
        base.notice_flag &&
        <HomeNotice title={base.notice_text} />
      }


      {/* 2. 标题 */}
      {
        base.title_flag &&
        <div className={`title-box animate__animated animate__${base.title_animate}`}>
          {
            base.title_img_flag &&
            <img className='img' src={base.title_img_url} />
          }
          {
            base.title_textFlag &&
            <span className="title">这是标题</span>
          }
        </div>
      }

      {/* 3. 首页总数统计 */}
      <HomeStatis base={base} />

      {/* 4. 日历 */}
      <CalendarBox animate={base.calendar_animate} />

      {/* 5. 图表 */}
      <HomeChart base={base} chart={chart} chartTap={chartTap} actKey={actKey} />

    </div>
  )
}
export default React.memo(HomePage)